home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C# & Game Programming - A…er's Guide (2nd Edition)
/
Buono 2nd Ed.iso
/
Chapter1
/
1.29
/
1.29.cs
next >
Wrap
Text File
|
2004-09-01
|
659b
|
21 lines
/* Integer subtraction. */
using System;
namespace Chapter1 {
class Class1 {
static void Main() {
int number1, number2, total;
number1 = 5;
number2 = 2;
total = number1 - number2; /* 5 - 2 */
Console.WriteLine(" {0,3}\n-{1,3}\n ---\n {2,3}",
number1, number2, total);
Console.WriteLine("\n {0,3:D}\n-{1,3:D}\n ---\n {2,3:D}",
number1, number2, total);
Console.WriteLine("\n {0,3:X}\n-{1,3:X}\n ---\n {2,3:X}",
number1, number2, total);
}
}
}